package com.chagee.store.operation.api.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * @Author : hk
 * @Date : 2024/11/15
 */

@Getter
@AllArgsConstructor
public enum UserTypeEnum {

	MASTER(1, "主账号"),
	SUBACCOUNT(2, "子账号"),

	;
	private final Integer type;
	private final String desc;

	public static UserTypeEnum getByType(Integer type) {
		for (UserTypeEnum value : values()) {
			if (Objects.equals(value.getType(), type)) {
				return value;
			}
		}
		return null;
	}
}
